home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 8710 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Problem Negating an Unsigned Char
  5. Date: Tue, 05 Mar 96 15:16:13 GMT
  6. Organization: none
  7. Message-ID: <826038973snz@genesis.demon.co.uk>
  8. References: <Dnnros.Lq.0.-s@hkusuc.hku.hk> <4he27sINNdel@keats.ugrad.cs.ubc.ca> <4he5f0$acv@solutions.solon.com> <4hfkk6INN2tm@keats.ugrad.cs.ubc.ca> <4hgag5$8r8@solutions.solon.com>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <4hgag5$8r8@solutions.solon.com>
  15.            seebs@solutions.solon.com "Peter Seebach" writes:
  16.  
  17. >In article <4hfkk6INN2tm@keats.ugrad.cs.ubc.ca>,
  18. >Kazimir Kylheku <c2a192@ugrad.cs.ubc.ca> wrote:
  19. >>In article <4he5f0$acv@solutions.solon.com>,
  20. >>Peter Seebach <seebs@solutions.solon.com> wrote:
  21. >> >In article <4he27sINNdel@keats.ugrad.cs.ubc.ca>,
  22. >> >Kazimir Kylheku <c2a192@ugrad.cs.ubc.ca> wrote:
  23. >> >>To make it portable, you must manually mask for the lower eight bits:
  24. >
  25. >> >>    if (a == (~b & 0xff))
  26. >
  27. >> >Close, but the cigar yet escapes you.
  28. >
  29. >>No it does not. I _wanted_ eight bit arithmetic, not CHAR_BIT arithmetic.
  30. >
  31. >Oh.  I assumed the goal was to get the effect of negating all the bits in
  32. >a char.  Never mind.
  33.  
  34. As my old music teacher used to say - "Read the question; if it asks you
  35. to write an essay on `white' and you write the world's greatest essay
  36. on `black' you will get no marks."
  37.  
  38. :-)
  39.  
  40. -- 
  41. -----------------------------------------
  42. Lawrence Kirby | fred@genesis.demon.co.uk
  43. Wilts, England | 70734.126@compuserve.com
  44. -----------------------------------------
  45.